#!/bin/sh

#use mingw/msys

tar zxvf onig-5.9.1.tar.gz
patch onig-5.9.1/regenc.h < ./patch/regenc.h.patch 

cd ./onig-5.9.1
./configure
make

cd ../src
gcc -Wall -O2 -I../onig-5.9.1 -c onigvw.c ptrreg.c
dllwrap --export-all --driver-name gcc -o ../onigvw.dll onigvw.o ../onig-5.9.1/.libs/libonig.a ptrreg.o
